<?php

namespace App\Kuafu\Mqtt\Controller;

use App\Kuafu\Base\Controller\BaseController;
use App\Kuafu\Mqtt\Service\MqttService;
use Illuminate\Http\Request;

class MqttController extends BaseController
{

    /**
     * 发送MQTT
     */
    public function index(Request $request)
    {
        $this->validate($request, [
            'shopId'  => 'required|numeric',
            'command' => 'required|string',
            'params'  => 'required|array',
        ]);

        (new MqttService())->sendMqtt($request->shopId, $request->command, $request->params);

        return $this->success();
    }





}
